import * as charts from 'echarts';

type EChartsOption = charts.EChartsOption;

const getOption = () => {
  const option: EChartsOption = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'cross',
        crossStyle: {
          color: '#999',
        },
      },
    },
    xAxis: [
      {
        type: 'category',
        data: [
          '一月',
          '二月',
          '三月',
          '四月',
          '五月',
          '六月',
          '七月',
          '八月',
          '九月',
          '十月',
          '十一月',
          '十二月',
        ],
        axisPointer: {
          type: 'shadow',
        },
      },
    ],
    yAxis: [
      {
        type: 'value',
        // name: 'Precipitation',
        min: 0,
        max: 20,
        interval: 4,
        axisLabel: {
          formatter: '{value}',
        },
      },
    ],
    series: [
      {
        // name: 'Precipitation',
        type: 'bar',
        tooltip: {
          valueFormatter: function (value: any) {
            return (value as number) + '次';
          },
        },
        data: [2, 2, 2, 2, 2, 9, 2, 2, 2, 2, 2, 2],
      },
    ],
  };
  return option;
};

export default getOption;
